package lab02.test11;

public class Rectangle implements Printx {
    //属性：长、宽
    double longth;
    double width;

    //方法：求面积、求周长
   double area(){
       return longth*width;
   }
    double perimeter(){
       return 2*(longth+width);
    }
    @Override
    public void printMyWay() {
        System.out.println(longth);
        System.out.println(width);
        System.out.println(area());
        System.out.println(perimeter());
    }
}
